using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.PlcInfos
{
    public class PlcInfoConfig : IEntityTypeConfiguration<PlcInfo>
    {
        public void Configure(EntityTypeBuilder<PlcInfo> builder)
        {
            builder.HasComment("Plc信息表");
            builder.Property(x => x.PlcName).IsRequired().HasMaxLength(30).HasComment("PLC名");
            builder.Property(x => x.PlcIp).IsRequired().HasMaxLength(30).HasComment("PlcIp地址");
            builder.Property(x => x.PlcPort).HasMaxLength(30).HasComment("Plc端口，socket用");
            builder.Property(x => x.PlcType).IsRequired().HasMaxLength(30).HasComment("PLC类型：srm、con、agv");
            builder.Property(x => x.MaxBay).HasComment("最大列");
            builder.Property(x => x.MachineName).HasDefaultValue("").HasMaxLength(50).HasComment("机器名");
            builder.Property(x => x.PortName).HasDefaultValue("").HasMaxLength(50).HasComment("端口名");

        }
    }
}